/***************************************************************************************************
  Copyright(C)   2011-9-13
  All rights reserved.
  File Name: bulletinlist.h

  Description:　文字类播放列表处理。分析一个滚动文字类的播表，并调用滚动文字
                    显示模块显示文字


  ***************************************************************************************************/

#ifndef BULLETINLIST_H
#define BULLETINLIST_H

#include <QObject>
#include <QTextCodec>

#include "environment.h"
#include "../bulletinboard/scrolllabel.h"
#include "public/configclass.h"
#include "log.h"

extern QString g_installPath;

class bulletinlist : public QObject
{
    Q_OBJECT
    LOG4QT_DECLARE_QCLASS_LOGGER


public:
    explicit bulletinlist(uint number = 0, QObject *parent = 0);
    ~bulletinlist();

    void initList();
    void updateList(const RoutePkgStruct& routePkg);
    bool isStop();
    void setScrollSpeed(const int speed);

    void stop();
    void hide();
    void show();

    void updateDateState(const QString& msg);

    void onlyShowText(const RoutePkgStruct& routePkg);
private:
    bool loadTextFile(const QString& filePath);

signals:
    void msgArrive(uint typeID, uint number, long msg = 0);

public slots:
    void timeToStop();

private:
    ScrollLabel * m_scroll;

    QStringList m_fileList;
    QList<int> m_playTimeList;
    int m_nCur;

    QTimer *m_playTimer;
    bool m_isPlayFinish;

    int m_nNumber;
    int m_isOnlyShowTxt;        //是否只是显示文字，滚动功能去除
};

#endif // BULLETINLIST_H
